<!--
 * @Description: 伸缩盒
 * @Author: charles
 * @Date: 2021-08-13 10:00:57
 * @LastEditors: charles
 * @LastEditTime: 2021-08-13 10:11:13
-->
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>伸缩盒</title>
  <style>
    div.container {
      width: 500px;
      height: 300px;
      margin: 0 auto;
      background-color: #ccc;
      padding: .5em;

      display: flex;
      flex-direction: row;
      flex-wrap: wrap;
    }
    div.container > div {
      /* flex-grow: 1; */
    }
    div.container > div:nth-child(1) {
      background-color: lightblue;
      flex-basis: 150px;
    }
    div.container > div:nth-child(2) {
      background-color: lightcoral;
      flex-basis: 150px;
    }
    div.container > div:nth-child(3) {
      background-color: lightgreen;
      flex-basis: 150px;
    }
    div.container > div:nth-child(4) {
      background-color: lightpink;
      flex-basis: 150px;
    }
  </style>
</head>
<body>
  <div class="container">
    <div>one</div>
    <div>two</div>
    <div>three</div>
    <div>four</div>
  </div>
</body>
</html>
